<template>
    <div class="throttle-container">
       <button @click="clickButton" v-throttle>快速点击有效{{ index }}次</button>
    </div>
</template>

<script>
import { defineComponent, ref } from 'vue'
export default defineComponent({
  setup () {
    const index = ref(0)
    const clickButton = () => {
      index.value++
    }
    return {
      index,
      clickButton
    }
  }
})
</script>

<style lang="less" scoped>
    .throttle-container {
        display: flex;
        justify-content: center;
        padding-top: 50px;
        button {
            width: 50%;
            text-align: center;
            height: 70px;
            line-height: 70px;
            border-radius: 15px;
            background-color: #426fe9;
            color: #fff;
            border: none;
        }
    }
</style>
